<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/12
 * Time: 17:40
 */

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
class RecordList extends Model
{
    /**
     * 手动分红交易记录表
     * @var string
     */
    protected $table = 'record_list';
    protected $fillable = [
        'id',
        'total_amount',
        'user_num',
        'number',
        'single',
        'type',
        'status',
        'remark',
        'bonus_sn',
        'verifier',
        'time',
//        'created_at',
        'updated_at',

    ];
    /**
     * 添加交易记录
     * @param array $order
     * @return bool|int
     */
    public function add_record($order = array())
    {
        if(empty($order)){
            return false;
        }
        $order['updated_at'] = date('Y-m-d H:i:s');
        $order['created_at'] = date('Y-m-d H:i:s');
        $rico = $this->insertGetId($order);
        if ($rico) {
            return $rico;
        } else {
            return false;
        }
    }
}